package v1

import (
	"gin-vben-admin/internal/constant"
	"gin-vben-admin/pkg/db"
)

type SysUserCreateReq struct {
	AuthId int64 `json:"-" binding:"required"` //创建者

	Username string          `form:"username" json:"username" binding:"required,min=5,max=30" comment:"用户名" msg:"用户名格式错误"` //用户名
	Password string          `form:"password" json:"password" binding:"required,min=6,max=30" comment:"密码"`                //昵称
	NickName string          `form:"nick_name" json:"nick_name" binding:"omitempty,max=30" comment:"昵称"`                   //昵称
	Avatar   string          `form:"avatar" json:"avatar" binding:"omitempty,url" comment:"头像地址"`                          //头像地址
	Phone    string          `form:"phone" json:"phone" binding:"omitempty" comment:"手机号"`                                 //手机号
	Email    string          `form:"email" json:"email" binding:"omitempty,email" comment:"邮箱"`                            //油箱
	RoleId   int64           `form:"role_id" json:"role_id" binding:"required,gt=0" comment:"角色"`                          //角色id
	Sex      int             `form:"sex" json:"sex" binding:"required,oneof=1 2" comment:"性别"`                             //性别，1男2女
	DeptId   int64           `form:"dept_id" json:"dept_id" binding:"required,gt=0" comment:"部门"`                          //部门id
	Status   constant.Status `form:"status" json:"status" binding:"required,oneof=1 2" comment:"状态"`                       //状态1启用2禁用
	Remark   string          `form:"remark" json:"remark" binding:"omitempty" comment:"备注"`                                //备注
}

type SysUserListReq struct {
	Kw     string          `json:"kw" query:"kw" form:"kw" binding:"omitempty"`
	DeptId int64           `form:"dept_id" json:"dept_id" binding:"omitempty"`         //油箱
	RoleId int64           `form:"role_id" json:"role_id" binding:"omitempty"`         //角色id
	Status constant.Status `form:"status" json:"status" binding:"omitempty,oneof=1 2"` //状态1启用2禁用
	db.Paginator
}

type SysUserResetPwdReq struct {
	Password    string `form:"password" json:"password" binding:"required,min=5,max=30"`         //旧密码
	NewPassword string `form:"new_password" json:"new_password" binding:"required,min=5,max=30"` //新密码
}

type SysUserUpdateReq struct {
	AuthId int64 `json:"-" binding:"required"` //创建者

	UID      int64           `form:"uid" json:"uid" binding:"required" comment:"用户ID" msg:"用户ID格式错误"`        //用户ID
	Password string          `form:"password" json:"password" binding:"omitempty,min=6,max=30" comment:"密码"` //昵称
	NickName string          `form:"nick_name" json:"nick_name" binding:"omitempty,max=30" comment:"昵称"`     //昵称
	Avatar   string          `form:"avatar" json:"avatar" binding:"omitempty,url" comment:"头像地址"`            //头像地址
	Phone    string          `form:"phone" json:"phone" binding:"omitempty" comment:"手机号"`                   //手机号
	Email    string          `form:"email" json:"email" binding:"omitempty,email" comment:"邮箱"`              //油箱
	RoleId   int64           `form:"role_id" json:"role_id" binding:"required,gt=0" comment:"角色"`            //角色id
	Sex      int             `form:"sex" json:"sex" binding:"required,oneof=1 2" comment:"性别"`               //性别，1男2女
	DeptId   int64           `form:"dept_id" json:"dept_id" binding:"required,gt=0" comment:"部门"`            //部门id
	Status   constant.Status `form:"status" json:"status" binding:"required,oneof=1 2" comment:"状态"`         //状态1启用2禁用
	Remark   string          `form:"remark" json:"remark" binding:"omitempty" comment:"备注"`                  //备注
}
